package com.zhiche.lisa.bms.pojo.vo.contract;

import com.zhiche.lisa.bms.dao.model.contract.Contract;
import com.zhiche.lisa.bms.dao.model.contract.ContractAccessory;
import com.zhiche.lisa.bms.dao.model.contract.ContractFleetDtl;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

public class ContractVO {
    private Contract contract;
    private List<ContractAccessory> contractAccessories;
    private List<ContractFleetDtl> contractFleetDtls;

    public Contract getContract() {
        return contract;
    }

    public void setContract(Contract contract) {
        this.contract = contract;
    }

    public List<ContractAccessory> getContractAccessories() {
        return contractAccessories;
    }

    public void setContractAccessories(List<ContractAccessory> contractAccessories) {
        this.contractAccessories = contractAccessories;
    }

    public List<ContractFleetDtl> getContractFleetDtls() {
        return contractFleetDtls;
    }

    public void setContractFleetDtls(List<ContractFleetDtl> contractFleetDtls) {
        this.contractFleetDtls = contractFleetDtls;
    }

    public void addContractFleetDtl(ContractFleetDtl contractFleetDtl) {
        if (CollectionUtils.isEmpty(this.contractFleetDtls)) {
            this.contractFleetDtls = new ArrayList<>();
        }
        this.contractFleetDtls.add(contractFleetDtl);
    }
}
